package com.nchuoj.question.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.nchuoj.question.mapper.TestCaseMapper;
import com.nchuoj.question.pojo.TestCase;
import com.nchuoj.question.service.TestCaseService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author lenovo
 * @description 针对表【test_case】的数据库操作Service实现
 * @createDate 2022-12-24 16:30:17
 */
@Service
public class TestCaseServiceImpl extends ServiceImpl<TestCaseMapper, TestCase>
        implements TestCaseService {


    /**
     * 根据题目id查询它所对应的测试用例数组
     *
     * @param qid 题目id
     * @return 测试用例数组
     */
    @Override
    public List<TestCase> getTestCaseListByQid(Integer qid) {
        LambdaQueryWrapper<TestCase> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(TestCase::getQid, qid);
        return this.list(queryWrapper);
    }
}




